from time import time

def li(func):
    def wrapper():
        a = time()
        func()
        print('该函数的执行时间为：{}'.format(time() - a))

    return wrapper
@li
def func():
    a = 0
    for i in range(1000000):
        a += 1
    type('hello')
func()

@li
def fc():
    b = 0
    for each in range(1000000):
        b += 1
    isinstance('hello',str)
fc()

###type()执行速度快于isinstance()